
class Point(object):
    def __init__(self, x = 0, y = 0):
        super(Point, self).__init__()
        self.x = x
        self.y = y

class Line(object):
    def __init__(self, a, b):
        super(Line, self).__init__()
        self.a = a
        self.b = b
    def put_point(self, point):
        return self.a * point.x + self.b - point.y

class Segment(object):
    def __init__(self, p1, p2):
        super(Segment, self).__init__()
        self.p1 = p1
        self.p2 = p2
    def put_point(self, point):
        A = self.p1.y - self.p2.y
        B = self.p2.x - self.p1.x
        C = -(self.p1.x * A + self.p1.y * B)
        return A * point.x - B * point.y + C

class DirectedSegment(Segment):
    def __init__(self, p1, p2):
        super(DirectedSegment, self).__init__(p1, p2)

class Triangle(object):
    def __init__(self, p1, p2, p3):
        super(Triangle, self).__init__()
        self.p1 = p1
        self.p2 = p2
        self.p3 = p3
